#!/bin/sh
[ -z "${IPKG_INSTROOT}" ] || exit 0
[ "${PKG_UPGRADE}" = "1" ] && exit 0
eval $(/usr/bin/nginx-util get_env)
[ "$(uci get "nginx.${LAN_NAME}.${MANAGE_SSL}")" = "self-signed" ] || exit 0
rm -f "$(uci get "nginx.${LAN_NAME}.ssl_certificate")"
rm -f "$(uci get "nginx.${LAN_NAME}.ssl_certificate_key")"
exit 0
